import * as types from './mutation-types'

const mutations = {
	// 设置商家信息
	[types.SET_MERCHANT_INFO](state, merchantInfo) {
		state.merchantInfo = merchantInfo
	},
	// 设置二级分类
	[types.SET_SECOND_DIRECTORY](state, secondDirectory) {
		state.secondDirectory = secondDirectory
	},
	// 设置tab信息
	[types.SET_TAB_LIST](state, tabList) {
		state.tabList = tabList
	},
	// 设置tab选项
	[types.SET_TAB_CURRENT_INDEX](state, tabCurrentIndex) {
		state.tabCurrentIndex = tabCurrentIndex
	},
	
	// 设置商家信息配置
	[types.SET_MERINFO_CONFIG](state, merInfoConfig) {
		state.merInfoConfig = merInfoConfig
	},
	// 设置公钥
	[types.SET_PUBLIC_KEY](state, key) {
		console.log(key)
		state.public_key = key
	},
	
	// 设置会员等级
	[types.SET_SENIOR_MALL](state, flag) {
		console.log(state, flag)
		state.seniorMall = flag
	},
	// 设置会员注册审核权限是否开通
	[types.SET_MEMBER_AUDIT](state, memberAudit) {
		console.log(state, memberAudit)
		state.memberAudit = memberAudit
	},
	
	[types.SET_SIDEBAR_STYLE](state, classNameFlag) {
		console.log(state, classNameFlag)
		state.classNameFlag = classNameFlag
	},
	
	// 设置每一步的缓存
	[types.SET_STEP_CACHE](state, stepCache) {
		console.log(state, stepCache)
		state.stepCache.goodId = stepCache.goodId ? stepCache.goodId : ''
		state.stepCache.gcId = stepCache.gcId ? stepCache.gcId : ''
		state.stepCache.goBackFlag = stepCache.goBackFlag ? stepCache.goBackFlag : false
		state.stepCache.firstCartId = stepCache.firstCartId ? stepCache.firstCartId : '' 
		state.stepCache.secondCartId = stepCache.secondCartId ? stepCache.secondCartId : ''
		state.stepCache.queryAttrList = stepCache.queryAttrList ? stepCache.queryAttrList : null
	}
	
	
}
export default mutations